import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _regeneratorRuntime from "@babel/runtime/regenerator";
import { getResponse } from 'utils/utils';
import { logout as _logout } from "../services/onlineService";
export default {
  namespace: 'online',
  state: {},
  effects: {
    // 登出
    logout: /*#__PURE__*/_regeneratorRuntime.mark(function logout(_ref, _ref2) {
      var payload, call, res;
      return _regeneratorRuntime.wrap(function logout$(_context) {
        while (1) {
          switch (_context.prev = _context.next) {
            case 0:
              payload = _ref.payload;
              call = _ref2.call;
              _context.next = 4;
              return call(_logout, payload);

            case 4:
              res = _context.sent;
              return _context.abrupt("return", getResponse(res));

            case 6:
            case "end":
              return _context.stop();
          }
        }
      }, logout);
    })
  },
  reducers: {
    updateState: function updateState(state, _ref3) {
      var payload = _ref3.payload;
      return _objectSpread(_objectSpread({}, state), payload);
    }
  }
};